namespace KTD.Web.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class init : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.Advs",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        advname = c.String(),
                        appid = c.String(),
                        bind = c.String(),
                        displayorder = c.Int(nullable: false),
                        enabled = c.Boolean(nullable: false),
                        link = c.String(),
                        query = c.String(),
                        thumb = c.String(),
                        toway = c.String(),
                        type = c.String(),
                        url = c.String(),
                        weid = c.String(),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Areas",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        lng = c.Single(nullable: false),
                        lat = c.Single(nullable: false),
                        enabled = c.Boolean(nullable: false),
                        bdpos = c.String(),
                        firstname = c.String(),
                        ishot = c.Boolean(nullable: false),
                        ison = c.Boolean(nullable: false),
                        name = c.String(),
                        sort = c.Int(nullable: false),
                        uniacid = c.Int(nullable: false),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Attachments",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        Name = c.String(),
                        Ext = c.String(),
                        ContentType = c.String(),
                        SavePath = c.String(),
                        Length = c.Long(nullable: false),
                        OSSId = c.Int(nullable: false),
                        Type = c.String(),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Comments",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        avatarUrl = c.String(),
                        content = c.String(),
                        ctype = c.String(),
                        createtime = c.DateTime(nullable: false),
                        hid = c.Int(nullable: false),
                        wechaname = c.String(),
                        parentId = c.Int(),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Houses",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        areaname = c.String(),
                        bdpos = c.String(),
                        bid = c.Int(nullable: false),
                        buildarea = c.String(),
                        cenggao = c.String(),
                        cenghubi = c.String(),
                        channel = c.String(),
                        cityid = c.Int(nullable: false),
                        click = c.Int(nullable: false),
                        clickstr = c.String(),
                        cname = c.String(),
                        companyname = c.String(),
                        createtime = c.String(),
                        fxmoney = c.Single(nullable: false),
                        gongtan = c.String(),
                        gw = c.String(),
                        houseaddress = c.String(),
                        houseareaid = c.Int(nullable: false),
                        housebus = c.String(),
                        housecovered = c.String(),
                        housegreenrate = c.String(),
                        housename = c.String(),
                        houseprice = c.Single(nullable: false),
                        houserate = c.String(),
                        housesaleaddress = c.String(),
                        houseschool = c.String(),
                        housestatus = c.String(),
                        housetype = c.String(),
                        housetypename = c.String(),
                        isrecommand = c.String(),
                        jiaofu = c.String(),
                        lat = c.Single(nullable: false),
                        lng = c.Single(nullable: false),
                        mianji = c.String(),
                        name = c.String(),
                        opensaletime = c.String(),
                        payway = c.String(),
                        productspecial = c.String(),
                        sort = c.Int(nullable: false),
                        status = c.Int(nullable: false),
                        staytime = c.String(),
                        tel = c.String(),
                        thumb = c.String(),
                        thumb_1 = c.String(),
                        thumb_2 = c.String(),
                        thumb_3 = c.String(),
                        thumb_url = c.String(),
                        tongqi = c.String(),
                        type = c.String(),
                        uid = c.Int(nullable: false),
                        uniacid = c.Int(nullable: false),
                        video = c.String(),
                        wuyefei = c.String(),
                        zonghushu = c.String(),
                        zongjia = c.String(),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Members",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        wechaname = c.String(),
                        avatarUrl = c.String(),
                        openid = c.String(),
                        uniacid = c.Int(nullable: false),
                        uid = c.Int(nullable: false),
                        status = c.Int(nullable: false),
                        score = c.Single(nullable: false),
                        name = c.String(),
                        mtime = c.Int(nullable: false),
                        isplat = c.Boolean(nullable: false),
                        ism = c.Boolean(nullable: false),
                        isagent = c.Boolean(nullable: false),
                        endtime = c.Int(nullable: false),
                        emtime = c.Int(nullable: false),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Navs",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        name = c.String(),
                        innerurl = c.String(),
                        link = c.String(),
                        thumb = c.String(),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.News",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        uniacid = c.Int(nullable: false),
                        title = c.String(),
                        des = c.String(),
                        sort = c.Int(nullable: false),
                        pid = c.Int(nullable: false),
                        sid = c.Int(nullable: false),
                        hits = c.Int(nullable: false),
                        status = c.Int(nullable: false),
                        thumb = c.String(),
                        content = c.String(),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.Salers",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        avatar = c.String(),
                        name = c.String(),
                        tel = c.String(),
                        wechat = c.String(),
                        content = c.String(),
                        platform = c.String(),
                        createtime = c.String(),
                        uniacid = c.String(),
                        houseid = c.Int(nullable: false),
                        uid = c.Int(nullable: false),
                        zan = c.Int(nullable: false),
                        czan = c.String(),
                        money = c.String(),
                        status = c.String(),
                        sort = c.String(),
                        type = c.String(),
                        code = c.String(),
                        ptel = c.String(),
                        gp = c.String(),
                        click = c.String(),
                        video = c.String(),
                        huoyue = c.Int(nullable: false),
                        url = c.String(),
                        housename = c.String(),
                        videos = c.Boolean(nullable: false),
                        CreateDateTime = c.DateTime(nullable: false),
                        Creator = c.String(),
                        UpdateDateTime = c.DateTime(),
                        Updater = c.String(),
                        Data = c.String(),
                    })
                .PrimaryKey(t => t.Id);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.Salers");
            DropTable("dbo.News");
            DropTable("dbo.Navs");
            DropTable("dbo.Members");
            DropTable("dbo.Houses");
            DropTable("dbo.Comments");
            DropTable("dbo.Attachments");
            DropTable("dbo.Areas");
            DropTable("dbo.Advs");
        }
    }
}
